const captureModel = require('../models/capture');
const ctrlObj = {
	getCaptureList(callback){
		captureModel.getCapture(data => {
			callback(JSON.parse(JSON.stringify(data)));
		})
	},
	createCapture(params, callback){
		captureModel.createCapture(params, data => {
			callback(data);
		})
	},
	updateCapture(params, callback){
		let id = params.id;
		delete params.id;
		captureModel.updateCapture(id, params, data => {
			if(data){
				callback(true);
			}else{
				callback(false);
			}
		});
	},
	deleteCapture(id, callback){
		captureModel.deleteCapture(id, data => {
			if(data){
				callback(true);
			}else{
				callback(false);
			}
		});
	}
}
module.exports = ctrlObj;